package com.xzr;

public class TV {
    int channel;

    public int getChannel() {
        return channel;
    }

    public void setChannel(int m) {
       if(m>=1){
           channel = m;
       }
    }
    void showProgram(){
        switch (channel){
            case 1:
                System.out.println("中央一台");
                break;
            case 2:
                System.out.println("中央二台");
                break;
            case 3:
                System.out.println("中央三台");
                break;
            case 4:
                System.out.println("体育频道");
                break;
            case 5:
                System.out.println("少儿频道");
                break;
            default:
                System.out.println(channel+"频道不能收看");
        }
    }
}
